<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>lesson 7</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
  <div id="root"></div>
</body>
<script>
  // {{}} 插值表达式
  // 讲解单项数据流的概念：子组件可以使用父组件传递过来的数据，但是绝对不能修改传递过来的数据
  const app = Vue.createApp({
    data() {
      return {
        num: 1,
      }
    },
    methods: {
      handleClick() {
        alert('click')
      }
    },
    //v-bind = 'params' 等价于 :content='params.content'
    template: `
      <div><counter :count="num"/></div>
    `
  });


  app.component('counter', {
    props: ['count'],
    template: `<div @click="count += 1">{{count}}</div>`
  })


  const vm = app.mount('#root');
</script>
</html>